package com.sjx.onelinecord.service

import android.app.Service
import android.content.Intent
import android.os.Binder
import android.os.IBinder
import android.util.Log

class MyService : Service() {

    private val mBinder: Binder = DownloadBinder()

    class DownloadBinder: Binder() {

        fun startDownLoad() {
            Log.i("MyService","startDownLoad executed")
        }

        fun getProgress(): Int {
            Log.i("MyService","getProgress executed")
            return 0
        }

    }

    override fun onBind(intent: Intent): IBinder {
        return mBinder
    }

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        Log.i("MyService","onStartCommand executed")
        return super.onStartCommand(intent, flags, startId)
    }

    override fun onCreate() {
        super.onCreate()
        Log.i("MyService","onCreate executed")
    }
    override fun onDestroy() {
        super.onDestroy()
        Log.i("MyService","onDestroy executed")
    }
}